#if !defined(ximera_physics_ode_rigidbody_hpp)
#define ximera_physics_ode_rigidbody_hpp

// -----------------------------------------------------------

#include <ximera/physics/irigidbody.hpp>
#include <ximera/physics/ode/ode.hpp>

namespace ximera { namespace physics { namespace ode
{
    class World;

	class XIMERA_PLUGIN_API RigidBody : public IRigidBody
    {
    public:
        RigidBody(World* world);
        virtual ~RigidBody();

        virtual math::Vector3 position() const;
        virtual void position(math::Vector3 const& pos);

        virtual math::Quaternion orientation() const;
        virtual void orientation(math::Quaternion const& quat);

        virtual math::Matrix3 orientationMatrix() const;
        virtual void orientationMatrix(math::Matrix3 const& orient);

        virtual math::Vector3 linearVelocity() const;
        virtual void linearVelocity(math::Vector3 const& vel);

        virtual math::Vector3 angularVelocity() const;
        virtual void angularVelocity(math::Vector3 const& vel);

        virtual Real mass() const;
        virtual void mass(Real value);

        virtual math::Vector3 force() const;
        virtual void force(math::Vector3 const& value);

        virtual math::Vector3 torque() const;
        virtual void torque(math::Vector3 const& value);

        virtual bool enabled() const;
        virtual void enabled(bool value);

        virtual BodyFlagT flags() const;
        virtual void flags(BodyFlagT value);

        virtual bool isFlagSet(BodyFlagT value) const;
        virtual void setFlag(BodyFlagT value);
        virtual void unsetFlag(BodyFlagT value);

        dBodyID bodyID() const { return _bodyID; }

    private:
        dBodyID _bodyID;
        BodyFlagT _flags;
        dMass _mass;
    };
}}}

// -----------------------------------------------------------

#endif
